#ifndef CD74HC4051_H
#define CD74HC4051_H

#include <Arduino.h>
#include <DigitalOut.h>

namespace ti
{

class CD74HC4051
{
public:
    enum class ChannelName{
        A0 = 0,
        A1 = 1,
        A2 = 2,
        A3 = 3,
        A4 = 4,
        A5 = 5,
        A6 = 6,
        A7 = 7
    };
    CD74HC4051(PinName pin_en,PinName pin_s0,PinName pin_s1,PinName pin_s2);
    ~CD74HC4051();

    void select_channel(ChannelName name);
    void enable(bool en);
private:
    DigitalOut _en;
    DigitalOut _s0;
    DigitalOut _s1;
    DigitalOut _s2;
};
}

#endif